using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class ShoppingCarMap : EntityTypeConfiguration<ShoppingCar>
    {
        public ShoppingCarMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.openid)
                .HasMaxLength(50);

            this.Property(t => t.pruduct_id)
                .HasMaxLength(50);

            this.Property(t => t.deletes)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("ShoppingCar");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.openid).HasColumnName("openid");
            this.Property(t => t.pruduct_id).HasColumnName("pruduct_id");
            this.Property(t => t.deletes).HasColumnName("deletes");
            this.Property(t => t.createtime).HasColumnName("createtime");
        }
    }
}
